package com.kitty.action;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionSupport;

public class LoginAction extends ActionSupport{

	 
	/**
	 * 
	 */
	private static final long serialVersionUID = 4757577130140213944L;

	public String execute() {
		System.out.println("execute.");
		return Action.INPUT;
	}

	@Override
	public void validate() {
		HttpServletRequest request = ServletActionContext.getRequest();
		String name = request.getParameter("name");
		
		if (!"kitty".equals(name)) {
			super.addActionError("name error!");
		}
		 
	}
	
	
	

}
